<table>
	<caption><g:message code="wf.workflowHistory.list" default="Workflow History"/></caption>
    <thead>
        <tr>
	   	    <th><g:message code="workflowHistory.id" default="SerialNumber" /></th>
	   	    <th><g:message code="workflowHistory.step" default="Step" /></th>
	   	    <th><g:message code="workflowHistory.status" default="Status"/></th>
	   	    <th><g:message code="workflowHistory.assignee" default="Assignee"/></th>
	   	    <th><g:message code="workflowHistory.lockRecord" default="Lock Record"/></th>
	   	    <th><g:message code="workflowHistory.description" default="Description"/></th>
			<th><g:message code="workflowHistory.createdBy" default="Created By" /></th>
			<th><g:message code="workflowHistory.lastModifiedBy" default="Last Modified By" /></th>
			<th><g:message code="workflowHistory.actions" default="Actions" /></th>
        </tr>
    </thead>
    <tbody>
    <g:each in="${workflowHistoryInstanceList}" status="i" var="workflowHistoryInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
            <td><g:link controller="workflowHistory" action="show" id="${workflowHistoryInstance?.id}">${fieldValue(bean: workflowHistoryInstance, field: "id")}</g:link></td>
			<td>${fieldValue(bean: workflowHistoryInstance, field: "step")}</td>
            <td>${fieldValue(bean: workflowHistoryInstance, field: "status")}</td>
			<td>${fieldValue(bean: workflowHistoryInstance, field: "step.assignee")}</td>
			<td>${fieldValue(bean: workflowHistoryInstance, field: "step.lockRecord")}</td>
            <td>${fieldValue(bean: workflowHistoryInstance, field: "description")}</td>
			<td>${workflowHistoryInstance?.createdBy?.encodeAsHTML()}, <g:formatDate date="${workflowHistoryInstance?.dateCreated}" /></td>
			<td>${workflowHistoryInstance?.lastModifiedBy?.encodeAsHTML()}, <g:formatDate date="${workflowHistoryInstance?.lastUpdated}" /></td>
			<td>
				<g:each in="${workflowHistoryInstance?.step?.actions}" status="j" var="workflowActionInstance">
					<g:if test="${workflowHistoryInstance?.status == '进行中'}">
						<g:link controller="workflowApproval" action="confirm" 
							params="[objectName: 'salesOrder', objectId : objectId, historyId :workflowHistoryInstance?.id , actionId : workflowActionInstance?.id, ownerId : ownerId, version : workflowHistoryInstance?.version]"
							>
							[${fieldValue(bean: workflowActionInstance, field: "name")}]
						</g:link>
					</g:if>
				</g:each>
			</td>
        </tr>
    </g:each>
    </tbody>
</table>
